package cn.kickegg.gc.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * @author by KickEGG
 * @createTime $YEAR-$MON-25 20:26
 * @Description java.lang.OutOfMemoryError: Java heap space
 */
public class HeapOOM {

  /**
   * 1M
   */
  private static final int SIZE = 1024 * 1024 ;

  public static void main(String[] args) {
    List<Byte> list = new ArrayList<Byte>(10) ;
    while (true){
      list.add((byte)SIZE);
    }
  }
}
DSS